package vis.core.mapper;

import vis.core.domain.db.SysUserRole;
import com.mybatisflex.core.query.QueryWrapper;

import java.util.List;

public interface SysUserRoleMapper extends ZBMapper<SysUserRole> {

    default List<String> getRoleIds(Object userId) {
        QueryWrapper eq = QueryWrapper.create().select("role_id").eq("user_id", userId);
        return selectObjectListByQueryAs(eq, String.class);
    }

    default List<String> getUserIds(Object roleId) {
        QueryWrapper eq = QueryWrapper.create().select("user_id").eq("role_id", roleId);
        return selectObjectListByQueryAs(eq, String.class);
    }


}